package com.pxxy.lawconsult.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;
import com.pxxy.lawconsult.bean.User;
import  com.pxxy.lawconsult.bean.LawerUser;;


@WebServlet("/ApplyLawerServlet")
public class ApplyLawerServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private Gson gson;
    public ApplyLawerServlet() {
        super();
        
    }

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.getWriter().append("Served at: ").append(request.getContextPath());
		doPost(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
		//设置编码方式
		request.setCharacterEncoding("UTF-8");//请求的编码方式
		response.setCharacterEncoding("UTF-8");//响应的编码方式
		gson=new Gson();
		PrintWriter printWriter=response.getWriter();
		//实例化律师对象
		LawerUser lawerUser=new LawerUser();
		//获取申请律师界面的数据
		String name=request.getParameter(lawerUser.getLawerName());//获取律师的姓名
		String office=request.getParameter(lawerUser.getOffice());//获取律师的单位
		String address=request.getParameter(lawerUser.getAddress());//获取律师的地址
		String speciality=request.getParameter(lawerUser.getSpeciality());//获取律师擅长的类别
		String tel=request.getParameter(User.TEL);//获取律师电话号码
		String email=request.getParameter(lawerUser.getEmail());//获取律师的邮箱
		String introduction=request.getParameter(lawerUser.getIntroduction());//获取律师的介绍
		String age=request.getParameter(Integer.toString(lawerUser.getLawerAge()));
		String sex=request.getParameter(Integer.toString(lawerUser.getLawerSex()));
		
	}

}
